/*
*
*系统设置模块接口
*
*/
angular.module("managerS", ["Common"]).service('sysmanagerservice', ['Restangular', '$http', '$rootScope', function (Restangular, $http, $rootScope) {

    //查询当前企业的信息
    //orgId  当前登录人的企业id
    this.findOrgInfo = function (params) {
        return Restangular.one("/organizationInfo").customPOST({ name: "My Message" }, "findOrgInfo", params);
    }
    

    //*****************************************************************************************/
    //获取防作弊配置
    this.getOrgConfigure = function (params) {
        return Restangular.one("validate").customPOST({ name: "My Message" }, "getOrgConfigure", params);
    };
    //新增或修改防作弊配置
    this.modifyOrgConfigure = function (params) {
        return Restangular.one("validate").customPOST({ name: "My Message" }, "modifyOrgConfigure", params);
    };

   
    /******************************企业的基本信息********************************************/
    //查询当前企业的信息
    //orgId  当前登录人的企业id
    this.findOrgInfo = function (params) {
        return Restangular.one("/organizationInfo").customPOST({ name: "My Message" }, "findOrgInfo", params);
    }
    //修改当前企业的信息
    //orgId  当前登录人的企业id
    this.updateOrgInfo = function (params) {
        return Restangular.one("/organizationInfo").customPOST({ name: "My Message" }, "updateOrgInfo", params);
    }
    //保存域名
    //organization_ID
    //domainName  域名
    //level  域名级别
    //10-已存在域名
    this.updateDomainName = function (params) {
        return Restangular.one("/organizationInfo").customPOST({ name: "My Message" }, "updateDomainName", params);
    }
    /******************************上传企业logo********************************************/
    //上传企业logo
    //logoFile  图片文件
    //orgid   登录人的企业id
    this.uploadLogo = function (params) {
        return $rootScope.fileurl + "/file/uploadLogo" + params;
    }
    //生成密钥对
    this.randomRSAKey = function (params) {
        return Restangular.one("/api").customPOST({ name: "My Message" }, "randomRSAKey", params);
    }
    
    /*****************************************开关*******************************************/
    // 获通用开关列表
    this.findOrgSwitch = function (params) {
        return Restangular.one("/switch").customPOST({ name: "My Message" }, "findOrgSwitch", params);
    }

    // 修改通用开关
    this.SaveOrUpdateSwitch = function (params) {
        return Restangular.one("/switch").customPOST({ name: "My Message" }, "SaveOrUpdateSwitch", params);
    }
    // 打开或关闭单个开关
    this.addOneSwitch = function (params) {
        return Restangular.one("/switch").customPOST({ name: "My Message" }, "addOneSwitch", params);
    }
    
} ]);
